xen: credit2: the private scheduler lock can be an rwlock.
authorDario Faggioli <dario.faggioli@citrix.com>
Fri, 15 Jul 2016 14:50:18 +0000 (16:50 +0200)
committerGeorge Dunlap <george.dunlap@citrix.com>
Mon, 18 Jul 2016 17:01:51 +0000 (18:01 +0100)
commite3566c190cfd3789aeea5e2273f5f8888ca8ec2f
tree0dcf5b40dfc358fb1afec45f298bfab82975f16d
parentd6baf64c890c7d55002e1213dffa715ea1cf6300
xen: credit2: the private scheduler lock can be an rwlock.

In fact, the data it protects only change either at init-time,
during cpupools manipulation, or when changing domains' weights.
In all other cases (namely, load balancing, reading weights
and status dumping), information is only read.

Therefore, let the lock be an read/write one. This means there
is no full serialization point for the whole scheduler and
for all the pCPUs of the host any longer.

This is particularly good for scalability (especially when doing
load balancing).

Also, update the high level description of the locking discipline,
and take the chance for rewording it a little bit (as well as
for adding a couple of locking related ASSERT()-s).

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
xen/common/sched_credit2.c